/* eslint-disable */
import Vue from 'vue'
import App from './App'
import router from './router'

//  注册轻提示框
import Toast from 'components/Toast'
Vue.use(Toast)

import Ripple from 'common/js/ripple'
Vue.use(Ripple)

import 'common/js/axios'
import store from 'store'
import VueLazyLoad from 'vue-lazyload'

// 全局组件
import 'common/js/global-components'

Vue.config.productionTip = false
Vue.use(VueLazyLoad, {
  preLoad: 1,
  error: './static/img/default.jpg',
  loading: './static/img/default.jpg'
})

if (window.__POWERED_BY_WUJIE__) {
  let instance;
  window.__WUJIE_MOUNT = () => {
    instance = new Vue({
      el: '#app-music',
      router,
      store,
      components: { App },
      template: '<App/>'
    })
  };
  window.__WUJIE_UNMOUNT = () => {
    instance.$destroy();
  };
} else {
  new Vue({
    el: '#app-music',
    router,
    store,
    components: { App },
    template: '<App/>'
  })
}

export { Toast, router, store }
